package com.yugao.fintech.framework.lock.manager;

import com.yugao.fintech.framework.lock.model.ILock;
import com.yugao.fintech.framework.lock.model.IntegrationRedisLock;
import org.springframework.integration.redis.util.RedisLockRegistry;

public class IntegrationRedisManager implements ILockManager {

    private final RedisLockRegistry redisLockRegistry;

    public IntegrationRedisManager(RedisLockRegistry redisLockRegistry) {
        this.redisLockRegistry = redisLockRegistry;
    }

    @Override
    public ILock getLock(String lockKey) {
        return new IntegrationRedisLock(lockKey, redisLockRegistry);
    }
}
